package com.seveneight.baijiesteward.ui.first.presenter;

import android.content.Context;

import com.seveneight.baijiesteward.bean.AnyBean;
import com.seveneight.baijiesteward.bean.MenuBean;
import com.seveneight.baijiesteward.http.MyCallBack;
import com.seveneight.baijiesteward.ui.first.contract.FirstMenuContract;
import com.seveneight.baijiesteward.ui.first.model.FirstMenuModel;

import java.util.List;

import okhttp3.RequestBody;

/**
 * Created by user1 on 2018/3/21.
 */

public class FirstMenuPresenter implements FirstMenuContract.MenuPresenter {

    FirstMenuContract.MenuView menuView;
    FirstMenuContract.MenuModel menuModel;

    public FirstMenuPresenter(FirstMenuContract.MenuView menuView) {
        this.menuView = menuView;
        menuModel=new FirstMenuModel();
    }

    @Override
    public void getFirstMenu( RequestBody body) {
        menuModel.getFirstMenu(body, new MyCallBack<List<MenuBean>>() {

            @Override
            public void onSuccess(List<MenuBean> data) {
                menuView.rebackMenuList(data);
            }

            @Override
            public void onFailed() {

            }
        });
    }
}
